home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Telecommunications / Updates⁄New / MicroPhone 2 Scripts / ChatMP2 / Do conv next >
Encoding:
Text File  |  1988-06-07  |  2.6 KB  |  63 lines  |  [TEXT/ttxt]

  1.  Settings File = TestBed
  2.  Script Name = Do conv
  3.  Command Key = 
  4.  F-key = 
  5.  Menu = YES
  6.  Button = NO
  7.  
  8. 1   Remark "This is the main script of the conversation package."
  9. 2   Remark "====================================="
  10. 3   Remark "Let 'InitConv' initialize the screen and variables."
  11. 4   Remark "====================================="
  12. 5   Do Script * "InitConv"
  13. 6   Remark "====================================="
  14. 7   Remark "This repeat loop is the heart of the conversation"
  15. 8   Remark "script. It watches the serial port and keyboard."
  16. 9   Remark "====================================="
  17. 10  Repeat
  18. 11    Remark "====================================="
  19. 12    Remark "Get the next key pressed if any."
  20. 13    Remark "====================================="
  21. 14    Set Variable inKey from Expression  "=NEXTKEY"
  22. 15    Remark "====================================="
  23. 16    Remark "If a key was pressed handle it."
  24. 17    Remark "====================================="
  25. 18    If Expression  "=Length(inKey) > 0"
  26. 19      Remark "====================================="
  27. 20      Remark "If the key is 'Esc' then set 'stopConv' to true."
  28. 21      Remark "====================================="
  29. 22      If Expression  "=ASCII(inKey)=27"
  30. 23        Set Variable stopConv from Expression  "=true"
  31. 24      Else
  32. 25        Remark "====================================="
  33. 26        Remark "Key is not 'Esc', so put it into 'keyboard' region."
  34. 27        Remark "====================================="
  35. 28        Do Script * "OutScroll"
  36. 29        Send Local to Screen  "=inKey"
  37. 30        Send Text String  "=inKey"
  38. 31        Remark "====================================="
  39. 32        Remark "If the key is 'CR' append a 'LF'."
  40. 33        Remark "====================================="
  41. 34        If Expression  "=ASCII(inKey)=13"
  42. 35          Send Local to Screen  "^J"
  43. 36          Send Text String  "^J"
  44. 37        End If
  45. 38        Remark "====================================="
  46. 39        Remark "Restore 'conversation' region."
  47. 40        Remark "====================================="
  48. 41        Do Script * "InScroll"
  49. 42      End If
  50. 43    Else
  51. 44      Remark "====================================="
  52. 45      Remark "There was no key pressed, so let 'Wait' command"
  53. 46      Remark "service the serial port and write incoming"
  54. 47      Remark "characters to the 'conversation' region."
  55. 48      Remark "====================================="
  56. 49      Wait Sixtieths  "20"
  57. 50    End If
  58. 51  Until Expression  "=stopConv"
  59. 52  Remark "====================================="
  60. 53  Remark "Restore terminal screen to its normal state."
  61. 54  Remark "====================================="
  62. 55  Chain to Script "unInitConv"
  63.